<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('路桩列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                                    <li>
                                        <label>序列号：</label>
                                        <input type="text" name="serialNumber"/>
                                    </li>
                                    <li class="select-time">
                                        <label>数据日期：</label>
                                        <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                               name="params[beginDataTime]"/>
                                        <span>-</span>
                                        <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                               name="params[endDataTime]"/>
                                    </li>
                                    <li>
                                        <label>所属路段：</label>
                                        <input type="text" name="roadSection"/>
                                    </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="road:road_stake:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()"
               shiro:hasPermission="road:road_stake:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="road:road_stake:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="road:road_stake:export">
                <i class="fa fa-download"></i> 导出
            </a>
            <div class="btn-group">
                <button data-toggle="dropdown" class="btn btn-warning dropdown-toggle">操作 <span
                        class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                    <li><a href="#"><button type="button" class="btn btn-info" id="button-open-1">初始化路面性能</button></a>
                    </li>
                    <li><a href="#"><button type="button" class="btn btn-info" id="button-open-4">初始化路面结构</button></a>
                    </li>
                    <li><a href="#"><button type="button" class="btn btn-info" id="button-open-6">初始化路面材料</button></a>
                    </li>
                    <li class="divider"></li>
                    </li>
                </ul>
            </div>

        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('road:road_stake:edit')}]];
    var removeFlag = [[${@permission.hasPermi('road:road_stake:remove')}]];
    var prefix = ctx + "road/road_stake";

    $(function () {
        var options = {
            url: prefix + "/rdRoadStakeList",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            showExport: false,
            exportOptions: {
                ignoreColumn: [0, 41]  //忽略第一列和最后一列
            },
            modalName: "路桩",
            columns: [[{
                title: '',
                align: 'center',
                printIgnore:true,
                colspan: 2
            }, {
                title: '基本信息',
                align: 'center',
                colspan:5
            }, {
                title: '路面性能',
                align: 'center',
                colspan: 2
            },  {
                title: '交通信息',
                align: 'center',
                colspan: 6
            }, {
                title: '气候环境',
                align: 'center',
                colspan: 2,
                visible: false
            }, {
                title: '路面结构',
                align: 'center',
                colspan: 5,
                visible: false
            }, {
                title: '空间信息',
                align: 'center',
                colspan: 6
            }, {
                title: '路面材料',
                align: 'center',
                colspan: 2
            }, {
                title: '路面材料',
                align: 'center',
                colspan: 4
            }, {
                title: '路面破损',
                align: 'center',
                colspan: 3
            }, {
                title: '检测数据',
                align: 'center',
                colspan: 5
            }, {
                title: '其他',
                align: 'center',
                colspan: 1
            }],[{
                printIgnore:true,
                checkbox: true
            },
                {
                    field: 'id',
                    title: '主键',
                    printIgnore:true,
                    visible: false
                },
                {
                    field: 'rdHighSpeedRoad.name',
                    align: 'center',
                    title: '归属高速',
                    templet:'<div>{{d.rdHighSpeedRoad.name}}</div>'
                },
                {
                    field: 'rdManagementUnit.name',
                    align: 'center',
                    title: '管养单位'
                },
                {
                    field: 'rdRoadSection.sectionName',
                    align: 'center',
                    title: '所属路段',
                    templet:'<div>{{d.rdRoadSection.sectionName}}</div>'
                },
                {
                    field: 'rdRoadSection.sectionId',
                    align: 'center',
                    title: '路段编号'
                },
                {
                    field: 'serialNumber',
                    align: 'center',
                    title: '路桩序列号'
                },
                // {
                //     field: 'roadInformation',
                //     title: '路面信息'
                // },
                {
                    field: 'pavementPerformance.surfaceDeflection',
                    align: 'center',
                    title: '路表弯沉'
                },
                {
                    field: 'pavementPerformance.roadRoughness',
                    align: 'center',
                    title: '路面不平整度'
                },
                {
                    field: 'trafficInfo.annualAverageDailyTraffic',
                    align: 'center',
                    title: '年平均交通量'
                },
                {
                    field: 'trafficInfo.openingTime',
                    align: 'center',
                    title: '通车时间'
                },
                {
                    field: 'trafficInfo.upkeepTime',
                    align: 'center',
                    title: '保养时间'
                },
                {
                    field: 'trafficInfo.createRoldTime',
                    align: 'center',
                    title: '建路时间'
                },
                {
                    field: 'trafficInfo.laneNumber',
                    align: 'center',
                    title: '车道数'
                },
                {
                    field: 'trafficInfo.trafficLevel',
                    align: 'center',
                    title: '交通等级'
                },
                {
                    field: 'climateEnvironment.annualAverageTemperature',
                    align: 'center',
                    title: '年平均气温'
                },
                {
                    field: 'climateEnvironment.annualAverageRainfall',
                    align: 'center',
                    title: '年平均降雨量'
                },
                {
                    field: 'rdPavementStructure.combinationOfSurfaceStructure',
                    align: 'center',
                    title: '面层结构组合',
                    // formatter: function (value, row, index) {
                    //     return $.table.selectDictLabel(road_combinationOfSurfaceStructure, value);
                    // }
                },
                {
                    field: 'rdPavementStructure.combinationOfBaseStructure',
                    align: 'center',
                    title: '基层结构组合',
                },
                {
                    field: 'rdPavementStructure.combinationOfSurfaceThickness',
                    align: 'center',
                    title: '面层厚度组合',
                },
                {
                    field: 'rdPavementStructure.combinationOfBaseThickness',
                    align: 'center',
                    title: '基层厚度组合',
                    // formatter: function (value, row, index) {
                    //     return $.table.selectDictLabel(road_combinationOfBaseThickness, value);
                    // }
                },
                {
                    field: 'rdPavementStructure.subgradeConditions',
                    align: 'center',
                    title: '路基条件'
                },
                {
                    field: 'spatialInfo.longitude',
                    align: 'center',
                    title: '经度'
                },
                {
                    field: 'spatialInfo.latitude',
                    align: 'center',
                    title: '纬度'
                },
                {
                    field: 'spatialInfo.altitude',
                    align: 'center',
                    title: '高程'
                },
                {
                    field: 'spatialInfo.routeDirection',
                    align: 'center',
                    title: '路线方向',
                    // formatter: function (value, row, index) {
                    //     return $.table.selectDictLabel(road_direction, value);
                    // }
                },
                {
                    field: 'spatialInfo.startingStation',
                    align: 'center',
                    title: '起点桩号'
                },
                {
                    field: 'spatialInfo.terminalStation',
                    align: 'center',
                    title: '终点桩号'
                },
                {
                    field: 'rdPavementMaterials.combinationOfSurfaceMaterial',
                    align: 'center',
                    title: '面层材料组合',
                },
                {
                    field: 'rdPavementMaterials.combinationOfBaseMaterial',
                    align: 'center',
                    title: '基层材料组合',
                },
                {
                    field: 'roadLinearity.curvature',
                    align: 'center',
                    title: '曲率半径'
                },
                {
                    field: 'roadLinearity.turningDirection',
                    align: 'center',
                    title: '转弯方向',
                    // formatter: function (value, row, index) {
                    //     return $.table.selectDictLabel(road_turningDirection, value);
                    // }
                },
                {
                    field: 'roadLinearity.slope',
                    align: 'center',
                    title: '坡度'
                },
                {
                    field: 'roadLinearity.slopeDirection',
                    align: 'center',
                    title: '坡度方向',
                    // formatter: function (value, row, index) {
                    //     return $.table.selectDictLabel(road_slopeDirection, value);
                    // }
                },
                {
                    field: 'pavementDamage.longitudinalCrack',
                    align: 'center',
                    title: '纵向裂缝'
                },
                {
                    field: 'pavementDamage.transverseCrack',
                    align: 'center',
                    title: '横向裂缝'
                },
                {
                    field: 'pavementDamage.rut',
                    align: 'center',
                    title: '车辙'
                },
                {
                    field: 'monitoringData.PQI',
                    align: 'center',
                    title: 'PQI'
                },
                {
                    field: 'monitoringData.PCI',
                    align: 'center',
                    title: 'PCI'
                },
                {
                    field: 'monitoringData.RDI',
                    align: 'center',
                    title: 'RDI'
                },
                {
                    field: 'monitoringData.RQI',
                    align: 'center',
                    title: 'RQI'
                },
                {
                    field: 'monitoringData.SRI',
                    align: 'center',
                    title: 'SRI'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editFull(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]]
        }
        $.table.init(options);
    });
</script>
<script type="text/javascript">
    var prefix = ctx + "road/road_stake";
    //路面材料
    var prefixPavementMaterials=ctx +"road/pavement_materials";
    //路面结构
    var prefixPavementStructure=ctx +"road/pavement_structure";
    //路面性能
    var prefixPavementPerformance=ctx +"road/pavement_performance";

    $("#button-confirm").click(function () {
        $.modal.confirm("确认要点击确定吗?", function () {
            $.modal.alert("ok");
        });
    })

    $("#button-msgReload").click(function () {
        $.modal.msgReload("保存成功,正在刷新数据请稍后……", modal_status.SUCCESS);
    })

    $("#button-open-1").click(function (data) {
        $.modal.parentTab('路面性能', prefixPavementPerformance + "/form");
    })
    $("#button-open-4").click(function (data) {
        $.modal.parentTab('路面结构', prefixPavementStructure + "/form");
    })
    $("#button-open-6").click(function (data) {
        $.modal.parentTab('路面材料', prefixPavementMaterials + "/form");
    })
</script>
</body>
</html>
